#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  4 11:33:49 2018

@author: elsa
"""

import PIL
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

#设置所使用的字体
font = ImageFont.truetype("华文细黑.ttf", 30)

#打开图片
imageFile = "timeg.jpeg"
im1 = Image.open(imageFile)

#画图
draw = ImageDraw.Draw(im1)
#draw.text( (0,50), u'你好,世界!', font=font)
draw.text((160, 0), u'你好,世界XXXX2222!', (255, 0, 0), font=font)    #设置文字位置/内容/颜色/字体
draw = ImageDraw.Draw(im1)                          #Just draw it!

#另存图片
im1.save("target.jpeg")